package com.hdw.cms.utils;

import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class UeditorUtil {
	public static String getUeFileName(String content) {
		String regex = "/upload/(.*?)[\"$]";
		Matcher matcher = Pattern.compile(regex).matcher(content);
		String topicAttName = "";
		while (matcher.find()) {
			topicAttName += matcher.group(1).trim() + ",";
		}
		if (topicAttName == "") {
			return null;
		} else {
			return topicAttName.substring(0, topicAttName.length() - 1);
		} // 取出来的时候直接以逗号分割就行了
	}

	public static String[] dealUeFileName(String UeFileName) {
		String[] UeFileNameList = new String[] {};
		if(UeFileName!=null){
		UeFileNameList = UeFileName.split(",");
		return UeFileNameList;}else{
			return UeFileNameList;
		}
	}
}
